import request from '@/utils/http'
// import { useProfileStore } from '@/store'
import { THIRD_GAME } from '@/constants'
import { getItem } from '@/utils'

// const baseURL = '/api/v1'
// const profileStore = useProfileStore()
// const userInfo = profileStore.userInfo?.id
const headers = () => {
	return {
		uid: getItem(THIRD_GAME)?.uid,
		operator: getItem(THIRD_GAME)?.operator,
		authorization: `${getItem(THIRD_GAME)?.token}`
	}
}

// 游戏动画结束通知
export function gameEndSettled(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/settled',
		method: 'post',
		data
	})
}

// 获取公平性种子数据
export function getSeed(data?: any) {
	return request({
		headers: headers(),
		url: '/mini/seed/get',
		method: 'post',
		data
	})
}

// 修改客户端种子
export function seedRevise(data?: any) {
	return request({
		headers: headers(),
		url: '/mini/seed/revise',
		method: 'post',
		data
	})
}

export function minesUnsettled(data?: any) {
	return request({
		headers: headers(),
		url: '/mini/server/mines/unsettled',
		method: 'post',
		data
	})
}

export function playPlinko(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/plinko',
		method: 'post',
		data
	})
}

export function playLimbo(data: any) {
	return request({
		headers: headers(),
		// baseURL,
		url: '/mini/server/limbo',
		method: 'post',
		data
	})
}

export function playDice(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/dice',
		method: 'post',
		data
	})
}

export function playMines(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/mines',
		method: 'post',
		data
	})
}

export function playMinesField(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/mines/field',
		method: 'post',
		data
	})
}

export function exchangeMines(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/mines/claim',
		method: 'post',
		data
	})
}

export function playAutoMines(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/mines/auto',
		method: 'post',
		data
	})
}

export function viewGamesDetail(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/view',
		method: 'post',
		data
	})
}

export function playKeno(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/keno',
		method: 'post',
		data
	})
}

export function playWheel(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/wheel',
		method: 'post',
		data
	})
}

export function playDiamonds(data: any) {
	return request({
		headers: headers(),
		url: '/mini/server/diamonds',
		method: 'post',
		data
	})
}
